package com.gec.system.custom;


import com.gec.model.entity.SysEstateCount;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.Collections;


public class CustomUser extends User {

    /**
     * 我们自己的用户实体对象，要调取用户信息时直接获取这个实体对象
     */
    private SysEstateCount sysEstateCount;


    public CustomUser(SysEstateCount sysEstateCount, Collection<? extends GrantedAuthority> authorities){
        super(sysEstateCount.getLoginName(), sysEstateCount.getPassword(), authorities);
        this.sysEstateCount = sysEstateCount;
    }

    public SysEstateCount getSysEstateCount(){
        return sysEstateCount;
    }

    public void setSysEstateCount(SysEstateCount sysEstateCount){
        this.sysEstateCount = sysEstateCount;
    }

}
